function PlotSimulation(weather,aircraft,target,time,fig);
%*=+--+=#=+--      UAS Severe Weather Simulation Softeware        --+=#=+--+=#*%
%          Copyright (C) 2013 Regents of the University of Colorado.           %
%                             All Rights Reserved.                             %
%                                                                              %
%    This program is free software: you can redistribute it and/or modify      %
%    it under the terms of the GNU General Public License version 2 as         %
%    published by the Free Software Foundation.                                %
%                                                                              %
%    This program is distributed in the hope that it will be useful,           %
%    but WITHOUT ANY WARRANTY; without even the implied warranty of            %
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             %
%    GNU General Public License for more details.                              %
%                                                                              %
%    You should have received a copy of the GNU General Public License         %
%    along with this program.  If not, see <http://www.gnu.org/licenses/>.     %
%                                                                              %
%           Jack Elston                                                        %
%           elstonj@colorado.edu                                               %
%                                                                              %
%*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*%
  frame = weather.frame;
  offset_x = frame.u*(time-weather.t0);
  offset_y = frame.v*(time-weather.t0);
  %target.x = target.x+offset_x;
  %target.y = target.y+offset_y;
  target.radius = 200;

  %[x,y,z] = aircraft.pos;
  vector = aircraft.position;
  x = vector(1);
  y = vector(2);
  z = vector(3);

  window_size = 3000; %m

  figure(fig);

  subplot(3,3,[1,2,4,5,7,8])
  hold off;
  plot(weather,time,z,'rain wind il',fig);
  axis([x-window_size*2/3 x+window_size*2/3 y-window_size y+window_size]);
  hold on;
  PlotCircle(fig,target.x,target.y,target.radius); %50m search radius
  plot(target.x,target.y,'og','MarkerFaceColor',[0 1 0]);
  plot(aircraft,fig);

  subplot(2,3,3);
  plot(weather,time,z,'rain',fig);
  hold on;
  plot([x-2/3*window_size, x+2/3*window_size, x+2/3*window_size, x-2/3*window_size, x-2/3*window_size],[y+window_size, y+window_size, y-window_size, y-window_size, y+window_size],'y')
  title('Radar Map');

  subplot(4,3,9);
  plot(aircraft,fig,'alt');

  subplot(4,3,12);
  plot(aircraft,fig,'control',2);

  pause(0.1)
